﻿using System.Data.Services;
using System.Data.Services.Common;

namespace umbraco.DataServices {

    [System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)]
    public class Service : ServiceBase {

        public static void InitializeService(DataServiceConfiguration config) {
            config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
            config.DataServiceBehavior.AcceptProjectionRequests = true;
        }

        protected override void OnStartProcessingRequest(ProcessRequestArgs args) {
            this.CheckAuthorization();
        }

    }
}
